<template>
  <view class="notice-modal-overlay" v-if="visible" @click="handleClose">
    <view class="notice-modal" @click.stop>
      <view class="notice-header">
        <text class="notice-title">提现须知</text>
        <view class="close-btn" @click="handleClose">
          <text class="close-icon">×</text>
        </view>
      </view>
      
      <view class="notice-content">
        <view class="notice-item">
          <view class="notice-icon-wrapper">
            <image class="notice-icon" src="/static/gantan01.png" mode="aspectFit"></image>
          </view>
          <text class="notice-text">审核成功后，请在此处点击领取，提现方可到账</text>
        </view>
        
        <view class="notice-item">
          <view class="notice-number">1</view>
          <text class="notice-text">提现申请提交后，我们将在1-3个工作日内完成审核</text>
        </view>
        
        <view class="notice-item">
          <view class="notice-number">2</view>
          <text class="notice-text">审核通过后，资金将自动转入您绑定的微信账户</text>
        </view>
        
        <view class="notice-item">
          <view class="notice-number">3</view>
          <text class="notice-text">请确保您的微信账户信息正确，避免提现失败</text>
        </view>
        
        <view class="notice-item">
          <view class="notice-number">4</view>
          <text class="notice-text">如有疑问，请联系客服获取帮助</text>
        </view>
      </view>
      
      <view class="notice-footer">
        <view class="confirm-btn" @click="handleClose">
          <text class="confirm-text">我知道了</text>
        </view>
      </view>
    </view>
  </view>
</template>

<script setup>
import { defineProps, defineEmits } from 'vue'

// 定义props
const props = defineProps({
  visible: {
    type: Boolean,
    default: false
  }
})

// 定义事件
const emit = defineEmits(['close'])

// 处理关闭事件
const handleClose = () => {
  emit('close')
}
</script>

<style scoped>
.notice-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1002;
}

.notice-modal {
  width: 640rpx;
  max-height: 80vh;
  background: #fff;
  border-radius: 20rpx;
  position: relative;
  animation: noticeModalSlideIn 0.3s ease-out;
  display: flex;
  flex-direction: column;
}

@keyframes noticeModalSlideIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.notice-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 40rpx 40rpx 20rpx;
  border-bottom: 1rpx solid #f0f0f0;
}

.notice-title {
  font-size: 36rpx;
  font-weight: bold;
  color: #333;
}

.close-btn {
  width: 60rpx;
  height: 60rpx;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-icon {
  font-size: 40rpx;
  color: #999;
  line-height: 1;
}

.notice-content {
  padding: 30rpx 40rpx;
  flex: 1;
  overflow-y: auto;
}

.notice-item {
  display: flex;
  align-items: flex-start;
  margin-bottom: 30rpx;
}

.notice-item:last-child {
  margin-bottom: 0;
}

.notice-icon-wrapper {
  width: 40rpx;
  height: 40rpx;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 20rpx;
  margin-top: 4rpx;
}

.notice-icon {
  width: 32rpx;
  height: 32rpx;
}

.notice-number {
  width: 40rpx;
  height: 40rpx;
  background: #f5315c;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24rpx;
  font-weight: bold;
  margin-right: 20rpx;
  flex-shrink: 0;
}

.notice-text {
  flex: 1;
  font-size: 28rpx;
  color: #333;
  line-height: 1.6;
}

.notice-footer {
  padding: 20rpx 40rpx 40rpx;
}

.confirm-btn {
  width: 100%;
  height: 88rpx;
  background: #f5315c;
  border-radius: 44rpx;
  display: flex;
  align-items: center;
  justify-content: center;
}

.confirm-text {
  font-size: 32rpx;
  color: #fff;
  font-weight: bold;
}
</style>